import db from '../dbserver'
import Sequelize from 'sequelize'

const User = db.define('user', {
    id: {
        type: Sequelize.INTEGER(11),
        allowNull: false,
        primaryKey: true,
        autoIncrement: true
    },
    user_name: {
        type: Sequelize.STRING(255),
        allowNull: false
    },
    user_code: {
        type: Sequelize.STRING(255),
        allowNull: false
    },
    user_pass: {
        type: Sequelize.STRING(255),
        allowNull: false
    },
    user_phone: {
        type: Sequelize.STRING(30),
        allowNull: true
    },
    user_office_phone: {
        type: Sequelize.STRING(50),
        allowNull: true
    },
    user_sex: {
        type: Sequelize.STRING(2),
        allowNull: true
    },
    user_lastdate: {
        type: Sequelize.DATE,
        allowNull: true
    },
    user_nowdate: {
        type: Sequelize.DATE,
        allowNull: true
    },
    user_state: {
        type: Sequelize.INTEGER(1),
        allowNull: true
    },
    department: {
        type: Sequelize.STRING(50),
        allowNull: false
    },
    company: {
        type: Sequelize.STRING(50),
        allowNull: false
    }
}, {
    timestamps: false,
    freezeTableName: true,
    tableName: 'user'
});

export default User
